import { ApiProperty } from '@midwayjs/swagger'

import { PageVO, PostVO, ResultVO, RoleVO, UserVO } from '@/vo'

/**
 * 用户分页结果
 */
export class UserPageVO extends PageVO(UserVO) {}

/**
 * 获取用户分页结果
 */
export class GetUserPageVO extends ResultVO(UserPageVO) {}

/**
 * 用户新建表单数据结果
 */
class UserAddFormDataVO {
  @ApiProperty({ description: '岗位列表', type: [PostVO] })
  posts: ISysPostEntity[]

  @ApiProperty({ description: '角色列表', type: [RoleVO] })
  roles: ISysRoleEntity[]

  @ApiProperty({ description: '岗位ID列表' })
  postIds?: string[]

  @ApiProperty({ description: '角色ID列表' })
  roleIds?: string[]
}

/**
 * 获取用户新建表单数据结果
 */
export class GetUserAddFormDataVO extends ResultVO(UserAddFormDataVO) {}

/**
 * 获取用户更新表单数据结果
 */
export class GetUserEditFormDataVO extends GetUserAddFormDataVO {}
